#region Using

using System;
using System.Xml;
using System.Globalization;

#endregion

namespace SemanticEngine
{
	public class WriterBase
	{

		protected virtual void WriteAttribute(XmlWriter writer, string name, string value)
		{
			if (!string.IsNullOrEmpty(value))
			{
				writer.WriteAttributeString(name, value.ToString());
			}
		}

		protected virtual void WriteAttribute(XmlWriter writer, string name, DateTime value)
		{
			if (value != DateTime.MinValue)
			{
				writer.WriteAttributeString(name, value.ToString("yyyy-MM-ddTHH:mm:ss", CultureInfo.InvariantCulture));
			}
		}

		protected virtual void WriteAttribute(XmlWriter writer, string name, double value)
		{
			writer.WriteAttributeString(name, value.ToString("#0.##", CultureInfo.InvariantCulture));
		}

	}
}
